﻿'    DotNetIRCD - An IRC Daemon written in VB.Net
'    Copyright (C) 2012 GeorgeBush
'
'    This program is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 2 of the License, or
'    (at your option) any later version.
'
'    This program is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.
'
'    You should have received a copy of the GNU General Public License
'    along with this program. If not, see <http://www.gnu.org/licenses/>.

''' <summary>
''' A Class used to store a bind point for the server
''' </summary>
Public Class BindPoint

    ''' <summary>
    ''' Stores the Thread Number for this BindPoint
    ''' </summary>
    <Xml.Serialization.XmlIgnore()>
    Public Property ThreadNumber As Integer = 0

    ''' <summary>
    ''' The IP/HostName to bind to
    ''' </summary>
    Public Property IPHostName As String

    ''' <summary>
    ''' The port to listen on
    ''' </summary>
    Public Property Port As Integer

    ''' <summary>
    ''' Is this connection using SSL
    ''' </summary>
    Public Property SSL As Boolean

    ''' <summary>
    ''' The type of connections to allow on this binding
    ''' </summary>
    Public Property [Type] As ConnectionType

    ''' <summary>
    ''' Creates a new instance of the BindPoint class
    ''' </summary>
    ''' <param name="IPHostName">The IP/HostName to bind to</param>
    ''' <param name="Port">The port to listen on</param>
    ''' <param name="SSL">Is this connection using SSL</param>
    ''' <param name="Type">The type of connections to allow on this binding</param>
    Public Sub New(ByVal IPHostName As String, ByVal Port As String, Optional ByVal SSL As Boolean = False, Optional ByVal [Type] As ConnectionType = ConnectionType.Client)

        Me.IPHostName = IPHostName
        Me.Port = CInt(Port)
        Me.SSL = SSL
        Me.Type = Type

    End Sub

    ''' <summary>
    ''' Creates a new instance of the BindPoint class
    ''' </summary>
    Public Sub New()
    End Sub

End Class

''' <summary>
''' An enumeration used to describe the types of connection allowed on a server binding
''' </summary>
Public Enum ConnectionType As Integer

    ''' <summary>
    ''' Allows clients to connect to this binding
    ''' </summary>
    Client = 1

    ''' <summary>
    ''' Allows servers to link using this binding
    ''' </summary>
    ServerLink = 2

    ''' <summary>
    ''' Allows use of the Admin Application on this binding
    ''' </summary>
    AdminApp = 4

End Enum